<?php
	$title = mysql_escape_string($_POST ["title"]);
	$typeId = mysql_escape_string($_POST ["typeId"]);
// 	$content = htmlentities(mysql_escape_string($_POST ["content"]), ENT_NOQUOTES, "UTF-8");
	$content = htmlspecialchars(mysql_escape_string($_POST ["content"]));
	$top = mysql_escape_string($_POST ["top"]);
	$top = empty($top)?0:1;
	require_once ("../../config.inc.php");
	require_once ("../../include/mysql.inc.php");
	require_once ("../../include/article.inc.php");
	$articleDao = new Article();
	
	$flag = $articleDao->add($title, $content, "wzw", $typeId, "0", $top);
	if ($flag) {
		echo "添加文章成功！<br/><a href='../../admin/articleList.php'>跳转到文章列表</a>";
	}
	else {
		echo "添加文章失败！<br/><a href='' onclick='javascript:history.back(-1);'>返回到文章编辑页面</a>";
	}
	
?>